package com.ttx.pattern.example.builder.after;

/**
 * 导演类， 避免客户端代码深入建造过程
 * @author TimFruit
 * @date 2019/7/2 14:28
 */

public class ComputerDirector {
    
    public Computer buildHighConfigComputer(){
        ComputerBuilder cb=new HighConfComputerBuilder();

        // 封装构建过程, 按照"蓝图"导演构造产品
        cb.setCpu()
                .setMemory()
                .setHardDisk();

        return cb.build();
    }

    public Computer buildLowConfigComputer(){
        ComputerBuilder cb=new LowConfComputerBuilder();

        // 封装构建过程, 按照"蓝图"导演构造产品
        cb.setHardDisk()
                .setCpu()
                .setMemory();

        return cb.build();
    }
    
}
